package com.atguigu.gulimall.ware.entity.feign;

import com.atguigu.common.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("gulimall-gateway")
public interface ProductFeignService {

    /**
     * 匹配的路径/product/skuinfo/info/{skuId} vs /api/product/skuinfo/info/{skuId}
     * 1.让所有的请求过网关(安全 负载均衡等)
     *   1）匹配的路径/api/product/skuinfo/info/{skuId}
     *   2）服务名@FeignClient("gulimall-gateway")给网关服务所在机器发送请求
     * 2.直接让后台指定服务处理
     *   1）匹配的路径/product/skuinfo/info/{skuId}
     *   2）服务名@FeignClient("gulimall-product")给商品服务所在机器发送请求
     * @param skuId
     * @return
     */
    //@RequestMapping("/product/skuinfo/info/{skuId}")
    @RequestMapping("/api/product/skuinfo/info/{skuId}")
    public R info(@PathVariable("skuId") Long skuId);
}
